package edu.hawaii.webspider;

import static org.junit.Assert.*;

import org.junit.Test;
/**
 * This is the test class for the WebSpiderDispatch class.
 * @author kenglish
 *
 */
public class TestWebSpiderDispatcher {
  /**
   * Test the totalRunLinks static method.
   *
   */
  @Test
  public void testRunTotalLinks() {
    WebSpiderDispatcher.runTotalLinks("http://www.hackeystat.org", 10);
    assertTrue("should run -totallinks options", true) ;
  }
  /**
   * Test the runMostPopular static method.
   *
   */
  @Test
  public void testRunMostPopular() {
    WebSpiderDispatcher.runMostPopular("http://www.hackeystat.org", 10);    
    assertTrue("should run -mostpopular option", true) ;
  }
  /**
   * Test the main Method with no arguments.
   *
   */
  @Test
  public void testMain() {
    WebSpiderDispatcher.main(null);
    assertTrue("should run main", true) ;
  }
  /**
   * Test the man method with arguments.
   *
   */
  @Test
  public void testMainWithArgs() {
    String [] args = {"-totallinks","http://www.yahoo.com","5" };
    WebSpiderDispatcher.main(args);
    assertTrue("should run main with -totallinks", true) ;
  }
  /**
   * Test the main method with arguments.
   *
   */
  @Test
  public void testMainWithArgs2() {
    String [] args = {"-mostpopular","http://www.yahoo.com","5" };
    WebSpiderDispatcher.main(args);
    assertTrue("should run main with -totallinks",true ) ;
  }  
}
